/*     */ package com.lmpop.trade.ti_custword;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_custwordInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_custwordInfo()
/*     */   {
/*  17 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  27 */     Ti_custword ti_custword = new Ti_custword();
/*  28 */     ti_custword.setWord_id(map.getString("word_id"));
/*  29 */     ti_custword.setF_title(map.getString("f_title"));
/*  30 */     ti_custword.setF_content(map.getString("f_content"));
/*  31 */     ti_custword.setF_cust_id(map.getString("session_cust_id"));
/*  32 */     ti_custword.setF_user_id(map.getString("session_user_id"));
/*     */ 
/*  34 */     String result_code = "0";
/*     */     try {
/*  36 */       insert(dbmMgr, ti_custword);
/*     */     } catch (ApplicationException e) {
/*  38 */       e.printStackTrace();
/*  39 */       result_code = "1";
/*     */     }
/*  41 */     map.setString("result_code", result_code);
/*  42 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_custword ti_custword)
/*     */     throws ApplicationException
/*     */   {
/*  51 */     dbmMgr.update("insertTi_custword", ti_custword);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  61 */     String pkid_string = map.getString("pkid");
/*  62 */     String result_code = "0";
/*     */     try {
/*  64 */       if (!pkid_string.equals("")) {
/*  65 */         String[] pkStr = pkid_string.split("\\|");
/*  66 */         for (int i = 0; i < pkStr.length; i++) {
/*  67 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  71 */       e.printStackTrace();
/*  72 */       result_code = "1";
/*     */     }
/*  74 */     map.setString("result_code", result_code);
/*  75 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  84 */     dbmMgr.update("deleteTi_custword", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  94 */     Ti_custword ti_custword = new Ti_custword();
/*  95 */     ti_custword.setWord_id(map.getString("word_id"));
/*     */ 
/* 101 */     ti_custword.setB_content(map.getString("b_content"));
/* 102 */     ti_custword.setB_date(map.getString("b_date"));
/* 103 */     ti_custword.setB_user_id(map.getString("session_user_id"));
/* 104 */     ti_custword.setB_user_name(map.getString("session_user_name"));
/*     */ 
/* 106 */     String result_code = "0";
/*     */     try {
/* 108 */       update(dbmMgr, ti_custword);
/*     */     } catch (ApplicationException e) {
/* 110 */       e.printStackTrace();
/* 111 */       result_code = "1";
/*     */     }
/* 113 */     map.setString("result_code", result_code);
/* 114 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_custword ti_custword)
/*     */     throws ApplicationException
/*     */   {
/* 123 */     dbmMgr.update("updateTi_custword", ti_custword);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 135 */     Map params = (Hashtable)obj;
/* 136 */     if (start == 0)
/* 137 */       start = 0;
/*     */     else {
/* 139 */       start = (start - 1) * limit;
/*     */     }
/* 141 */     params.put("start", Integer.valueOf(start));
/* 142 */     params.put("limit", Integer.valueOf(limit));
/*     */ 
/* 144 */     return this.queryList.getList("getTi_custwordList", params);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 156 */     Map params = (Hashtable)obj;
/* 157 */     List list = this.queryList.getList("getTi_custwordCount", params);
/* 158 */     int count = 0;
/* 159 */     if ((list != null) && (list.size() > 0)) {
/* 160 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 161 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 162 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 165 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 175 */     return this.queryList.getList("getTi_custwordByPk", pk);
/*     */   }
/*     */ 
/*     */   public String getCustNameByCustID(String f_cust_id) {
/* 179 */     String cust_name = "";
/* 180 */     List list = this.queryList.getList("getCustNameByCustIDttr", f_cust_id);
/* 181 */     if ((list != null) && (list.size() > 0)) {
/* 182 */       Hashtable map = (Hashtable)list.get(0);
/* 183 */       cust_name = map.get("cust_name").toString();
/*     */     }
/* 185 */     return cust_name;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_custword.Ti_custwordInfo
 * JD-Core Version:    0.6.0
 */